home *** CD-ROM | disk | FTP | other *** search
/ VRML 2.0 Sourcebook (2nd Edition) / VRML 2.0 Sourcebook CD [md5 fed90f4f9c39d5a60d477058775c7e21].iso / book / win / ch08 / 08fig07.wrl < prev    next >
Text File  |  1996-09-23  |  2KB  |  66 lines

  1. #VRML V2.0 utf8
  2. # The VRML 2.0 Sourcebook
  3. # Copyright 1997 By
  4. # Andrea L. Ames, David R. Nadeau, and John L. Moreland
  5. Group {
  6.     children [
  7.     # Three rotating bars
  8.         DEF Bar1 Transform {
  9.             children Shape {
  10.                 appearance DEF White Appearance {
  11.                     material Material { }
  12.                 }
  13.                 geometry Box { size 1.5 0.2 0.2 }
  14.             }
  15.         },
  16.         DEF Bar2 Transform {
  17.             children Shape {
  18.                 appearance USE White
  19.                 geometry Box { size 0.2 1.5 0.2 }
  20.             }
  21.         },
  22.         DEF Bar3 Transform {
  23.             children Shape {
  24.                 appearance USE White
  25.                 geometry Box { size 0.2 0.2 1.5 }
  26.             }
  27.         },
  28.     # Animation clock
  29.         DEF Clock TimeSensor {
  30.             cycleInterval 4.0
  31.             loop TRUE
  32.         },
  33.     # Animation paths, one for each bar
  34.         DEF BarPath1 OrientationInterpolator {
  35.             key [ 0.0, 0.50, 1.0 ]
  36.             keyValue [
  37.                 0.0 0.0 1.0  0.0,
  38.                 0.0 0.0 1.0  3.14,
  39.                 0.0 0.0 1.0  6.28
  40.             ]
  41.         },
  42.         DEF BarPath2 OrientationInterpolator {
  43.             key [ 0.0, 0.50, 1.0 ]
  44.             keyValue [
  45.                 1.0 0.0 0.0  0.0,
  46.                 1.0 0.0 0.0  3.14,
  47.                 1.0 0.0 0.0  6.28
  48.             ]
  49.         },
  50.         DEF BarPath3 OrientationInterpolator {
  51.             key [ 0.0, 0.50, 1.0 ]
  52.             keyValue [
  53.                 0.0 1.0 0.0  0.0,
  54.                 0.0 1.0 0.0  3.14,
  55.                 0.0 1.0 0.0  6.28
  56.             ]
  57.         }
  58.     ]
  59. }
  60. ROUTE Clock.fraction_changed TO BarPath1.set_fraction
  61. ROUTE Clock.fraction_changed TO BarPath2.set_fraction
  62. ROUTE Clock.fraction_changed TO BarPath3.set_fraction
  63. ROUTE BarPath1.value_changed TO Bar1.set_rotation
  64. ROUTE BarPath2.value_changed TO Bar2.set_rotation
  65. ROUTE BarPath3.value_changed TO Bar3.set_rotation
  66.